class PageOutOfRangeException(Exception):
    def __init__(self, book_pages, start_page, end_page=None):
        self.book_pages = book_pages
        self.start_page = start_page
        self.end_page = end_page
        super().__init__(f"Page out of range: Book has {book_pages} pages, but {start_page} and {end_page} pages were requested.")
